package com.bobi.tfca.network.response

import com.google.gson.Gson

data class MemberResponse(
    var memberId: Int,
    var memberName: String,
    var birthday: String,
    var sex: String,
    var telephone: String,
    var email: String,
    var password: String,
    var memberStatus: Int,
    var role: String,
    var picture: String,
    var memberAge: String,
    var entryDate: String,
    var exitDate: String,
    var leaveWords: String
) {

    // 空的构造函数
    constructor() : this(0, "", "", "", "", "", "", 0, "", "", "", "", "", "")
    constructor(telephone: String, password: String) : this(
        0,
        "",
        "",
        "",
        telephone,
        "",
        password,
        0,
        "",
        "",
        "",
        "",
        "",
        ""
    )

    constructor(memberId: Int, memberName: String) : this(
        memberId,
        memberName,
        "",
        "",
        "",
        "",
        "",
        0,
        "",
        "",
        "",
        "",
        "",
        ""
    )

    constructor(
        memberId: Int,
        memberName: String,
        memberAge: String,
        headPhoto: String,
        role: String
    ) : this(memberId, memberName, "", "", "", "", "", 0, role, headPhoto, memberAge, "", "", "")

    fun toJson(): String {
        val gson: Gson = Gson()
        return gson.toJson(this)
    }
}